#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back
#define y1 y_alpha_1

using namespace std;

using ll = long long;
using db = double;
using vec = vector<int>;
using pii = pair<int,int>;

int read() {
	int x = 0; bool f = 0; char ch = getchar();
	while(!isdigit(ch)) f |= ch == '-',ch = getchar();
	while(isdigit(ch)) x = (x << 1) + (x << 3) + (ch ^ 48),ch = getchar();
	return f ? -x : x;
}

const int N = 1e6 + 10;

int p[N],n,stk[N];
bool vis[N];

void solve() {
	n = in;
	for(int i = 1,x;i <= n;i++) x = in,p[i] = i - x,vis[i] = 0;
	int cur = 1,top = 0; 
	while(!vis[cur]) stk[++top] = cur,vis[cur] = 1,cur = p[cur];
	vec ans; int lst = cur; ans.pb(cur); cur = stk[top];
	while(cur != lst) ans.pb(cur),cur = stk[--top];
	printf("%lu\n",ans.size()); for(auto x : ans) printf("%d ",x); puts("");
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("1.in","r",stdin);
#endif
	for(int T = in;T;T--) solve();
	return 0;
}
